import tensorflow as tf2
tf = tf2.compat.v1
# 要在Tensorflow2 中执行1.x的代码，必须先执行下面这句！
tf.disable_eager_execution()

a = tf.placeholder(tf.float32)
b = tf.placeholder(tf.float32)
c = tf.multiply(a, b)
d = tf.subtract(a, b)

sess = tf.Session()
init = tf.global_variables_initializer()
# 这里可以不用初始化，因为没有Variable
sess.run(init)

# result = sess.run([c, d], feed_dict={a: [8, 2, 3.5], b: [1.5, 2, 4]})
# print(result)
rc, rd = sess.run([c, d], feed_dict={a: [8, 2, 3.5], b: [1.5, 2, 4]})
print(rc)
